﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MvcShop.MVC.Services
{
    public static class KeyWordHandle
    {
        public static string[] Handle(string keyWord)
        {
            string[] keywords = new string[2];

            var x = keyWord.Trim().Split(' ');
            if (x.Length > 1)
            {
                int i = 0;
                foreach (var item in x)
                {
                    if (item != "" && i < 2)
                    {
                        keywords[i] = item;
                        i++;
                    }
                }
            }
            else
            {
                keywords[0] = x[0].TrimEnd();
            }
            return keywords;
        }
    }
}
